home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
WINDOWS
/
WB_33C.ARJ
/
NETWORK.TX$
< prev
next >
Wrap
Text File
|
1992-05-20
|
10KB
|
475 lines
NetAddCon
Connects network resources to imaginary local
disk drives or printer ports.
Syntax:
NetAddCon (net-path, password, local-name)
Parameters:
(s) net-path net resource or string returned by NetBrowse.
(s) password password required to access resource, or "".
(s) local-name local drive name or printer port.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
You can use NetAddCon to connect a local drive
to a network directory, in which case "local-
name" will be a drive name (eg, "Z:"). You can
also connect a local printer port to a network
print queue, in which case "local-name" will be
the name of the printer port (eg, "LPT1").
Use the NetBrowse function to obtain a value
for "net-path".
If no password is required, use a null string
("") for the "password" parameter.
Example:
availdrive = DiskScan(0)
drvlen = StrLen(availdrive)
If drvlen == 0 Then Goto nomore
availdrive = StrSub(availdrive, drvlen - 2, 2)
netpath = NetBrowse(0)
pwd = AskPassword("Enter password for",netpath)
NetAddCon(netpath, pwd, availdrive)
Exit
:nomore
Message("Connect Drive to Net", "No drives avail for assignment")
See Also:
NetAttach, NetBrowse, NetCancelCon, NetGetCon, NetMapRoot
***
NetAttach
Attaches to a network file server.
Syntax:
NetAttach (server-name)
Parameters:
(s) server-name name of the network file server.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
NetAttach("userapps")
See Also:
NetAddCon, NetDetach, NetLogin
***
NetBrowse
Displays a network dialog box allowing the user
to select a network resource.
Syntax:
NetBrowse (request#)
Parameters:
(i) request# see below.
Returns:
(s) see below.
Specifying a request# of 0 allows selection of
a network directory, and specifying a request#
of 1 allows selection of a network print queue.
This function returns a string that can be used
by NetAddCon to add a connection.
Example:
availdrive = DiskScan(0)
drvlen = StrLen(availdrive)
If drvlen == 0 Then Goto nomore
availdrive = StrSub(availdrive, drvlen - 2, 2)
netpath = NetBrowse(0)
pswd = AskPassword("Enter password for",netpath)
NetAddCon(netpath, pswd, availdrive)
Exit
:nomore
Message("Connect Drive to Net", "No drives avail for assignment")
See Also:
NetAddCon, NetMapRoot
***
NetCancelCon
Breaks a network connection.
Syntax:
NetCancelCon (name, force)
Parameters:
(s) name network resource name or local name.
(i) force force flag (see below).
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
If force is set to 0, NetCancelCon will not
break the connection if any files on that
connection are still open. If force is set to
1, the connection will be broken regardless.
Example:
availdrive = DiskScan(4)
n = ItemCount(availdrive, " ")
If n == 0 Then Exit
i = 1
dislist = ""
:loop
drv = ItemExtract(i, availdrive, " ")
dislist = StrCat(drv, Num2Char(9),
NetGetCon(drv), "|")
i = i + 1
If i < n Then Goto loop
availdrive = ItemSelect("Disconnect", dislist, "|")
NetCancelCon(availdrive, 0)
See Also:
NetAddCon, NetDetach, NetGetCon
***
NetDetach
Detaches from a network file server.
Syntax:
NetDetach (server-name)
Parameters:
(s) server-name name of the network file server.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
NetDetach("userapps")
See Also:
NetAttach, NetCancelCon
***
NetDialog
Brings up the network driver's dialog box.
Syntax:
NetDialog ( )
Parameters:
(none)
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
A network driver's dialog box displays
copyright information, and may allow access to
the network, depending on the particular
network driver. The WIL program will wait
until the network dialog terminates before
continuing.
Example:
NetDialog()
***
NetGetCaps
Returns information on network capabilities.
Syntax:
NetGetCaps (request#)
Parameters:
(i) request# see below.
Returns:
(i) see below.
NetGetCaps returns 0 if no network is installed
(it is the only network function you can use
without having a network installed and not get
an error).
Req# Return value
1 Network driver specification number
2 Type of network installed:
0 None
256 MS Network
512 Lan Manager
768 Novell NetWare
1024 Banyan Vines
1280 10 Net
(other) Other network
3 Network driver version number
4 Returns 1 if any network is installed
6 Bitmask indicating whether the network
driver supports the following
connect functions:
1 AddConnection
2 CancelConnection
4 GetConnection
8 AutoConnect via DOS
16 BrowseDialog
7 Bitmask indicating whether the network
driver supports the following
print functions:
2 Open Print Job
4 Close Print Job
16 Hold Print Job
32 Release Print Job
64 Cancel Print Job
128 Set number of copies
256 Watch Print Queue
512 Unwatch Print Queue
1024 Lock Queue Data
2048 Unlock Queue Data
4096 Driver will send QueueChanged
messages to Print Manager
8192 Abort Print Job
Example:
caps = NetGetCaps(6)
If caps & 16 Then Message("", "Your network supports BrowseDialog")
See Also:
NetGetUser, WinConfig, WinMetrics, WinParmGet
***
NetGetCon
Returns the name of a connected network resource.
Syntax:
NetGetCon (local-name)
Parameters:
(s) local-name local drive name or printer port.
Returns:
(s) name of network resource.
NetGetCon returns the name of the network
resource currently connected to "local-name".
Example:
local = AskLine("NetGetCon", "Enter local drive name", "")
If local == "" Then Exit
resource = NetGetCon(local)
Message("NetGetCon", "%local% is connected to %resource%")
See Also:
NetAddCon, NetCancelCon
***
NetGetUser
Returns the name of the user currently logged
into the network.
Syntax:
NetGetUser ( )
Parameters:
(none)
Returns:
(s) name of current user.
Example:
IniWritePvt("Current Users", "Excel",
NetGetUser(), "usagelog.ini")
Run("excel.exe", "")
See Also:
NetGetCaps
***
NetLogin
Performs a network login.
Syntax:
NetLogin (server-name, user-name, password)
Parameters:
(s) server-name name of the network file server.
(s) user-name name of the current user.
(s) password password required to access server, or "".
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
pwd = AskPassword("Hello", "Enter password for network access")
NetLogin("userapps", "admin1", pwd)
See Also:
NetAttach, NetLogout
***
NetLogout
Performs a network logout.
Syntax:
NetLogout (server-name)
Parameters:
(s) server-name name of the network file server.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
NetLogout("userapps")
See Also:
NetLogin
***
NetMapRoot
Maps a local drive to a network resource.
Syntax:
NetMapRoot (local-name, net-path)
Parameters:
(s) local-name local drive name.
(s) net-path net resource or string returned by NetBrowse.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function maps a local drive letter as the
fake root to a network resource. This is
supported by Novell NetWare, but may not work
with any other networks.
Example:
availdrive = DiskScan(0)
drvlen = StrLen(availdrive)
If drvlen == 0 Then Goto nomore
availdrive = StrSub(availdrive, drvlen - 2, 2)
netpath = NetBrowse(0)
NetMapRoot(availdrive, netpath)
Exit
:nomore
Message("Connect Drive to Net", "No drives avail for assignment")
See Also:
NetAddCon, NetBrowse, NetCancelCon
***
NetMemberGet
Determines whether the current user is a member
of a specific group.
Syntax:
NetMemberGet (server-name, group-name)
Parameters:
(s) server-name name of the network file server.
(s) group-name name of the group.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
member = NetMemberGet("userapps", "sales")
If member == @YES Then Run("notepad.exe", "dailyrpt.txt")
See Also:
NetMemberSet
***
NetMemberSet
Sets the current user as a member of a group.
Syntax:
NetMemberSet (server-name, group-name)
Parameters:
(s) server-name name of the network file server.
(s) group-name name of the group.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
NetMemberSet("userapps", "sales")
See Also:
NetMemberGet
***
NetMsgAll
Broadcasts a message to all users on the network.
Syntax:
NetMsgAll (server-name, message)
Parameters:
(s) server-name name of the network file server.
(s) message message to be broadcast.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
NetMsgAll("userapps", "System going down in 5 minutes.")
See Also:
NetMsgSend
***
NetMsgSend
Sends a message to a specific user on the network.
Syntax:
NetMsgSend (server-name, user-name, message)
Parameters:
(s) server-name name of the network file server.
(s) user-name name of the user to whom the message should be sent.
(s) message message to be sent.
Returns:
(i) @TRUE if successful; @FALSE if unsuccessful.
This function may not work with all networks.
Example:
NetMsgSend("userapps", "compmgr", "Are those reports ready yet?")
See Also:
NetMsgAll